<?php

namespace app\common\validate;

use think\Validate;

class UserManage extends Validate
{
    protected $rule = [
        "username" => "require|unique:user_manage", 
        "name" => "require", 
        "password" => "require|min:6",
        "passwords" => "require|confirm:password",
        "mobile" => "require|mobile|unique:user_manage",
        "store_cash" => "require|number",
        "rider_cash" => "require|number",
        'captcha'=>'require|captcha'
    ];

    protected $message = [
        "username.require" => "请输入账号",    
        "username.unique" => "该账号已经存在",  

        "name.require" => "请输入昵称",  

        "password.require" => "请输入密码", 
        "password.min" => "密码必须大于6位数", 
        "passwords.require" => "请重复确认密码",
        "passwords.confirm" => "两次输入的密码不一致",

        "mobile.require" => "手机号不可以为空", 
        "mobile.mobile" => "手机号格式错误", 
        "mobile.unique" => "该手机号已经存在",  

        
		"store_cash.require" => "请输每商家提现设置",
		"store_cash.number" => "每商家提现设置必须要是数字",


        
		"rider_cash.require" => "请输骑手端提现设置",
		"rider_cash.number" => "骑手端提现设置必须要是数字",

        "captcha.require" => "验证码不可以为空",
		"captcha.captcha" => "验证码不正确",
	
    ];

    protected $scene = [
        'add' => ['password',"username"],
        'edit' => ['name','store_cash','rider_cash'],
        'pass' => ['password','passwords'],
        'password'  =>  ['oldpassword', 'password', 'repassword'],
        'login'  =>  ['password','captcha','account.require'],
        'mobile_password_login' => ['password','mobile'],
    ];
}
